package br.com.timecardforpeon.domain;

import java.io.Serializable;

import br.com.timecardforpeon.domain.contentvalue.TimeCard4PeonContentValues;

public abstract class Domain implements Serializable {

	private static final long serialVersionUID = 5613580141983666371L;

	public static final String ID = "id";
	public static final long UNDEFINED = -1;
	
	protected long id = UNDEFINED;

	public long getId() {
		return this.id;
	}

	public void setId(long id) {
		this.id = id;
	}
	
	public abstract TimeCard4PeonContentValues<? extends Domain> getContentValues();
	
	public abstract String getTableName();

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (id ^ (id >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Domain other = (Domain) obj;
		if (id != other.id)
			return false;
		return true;
	}
}